unit uMain;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, ExtCtrls;

type
  TForm1 = class(TForm)
    lbl_User: TLabel;
    edt_Dwmc: TEdit;
    lbl1: TLabel;
    edt_Code: TMemo;
    Panel1: TPanel;
    btn_Encrypt: TBitBtn;
    btn_Decrypt: TBitBtn;
    Bevel1: TBevel;
    procedure btn_EncryptClick(Sender: TObject);
    procedure btn_DecryptClick(Sender: TObject);
    procedure edt_DwmcChange(Sender: TObject);
    procedure edt_CodeChange(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation
uses PwdFunUnit;
{$R *.dfm}

procedure TForm1.btn_DecryptClick(Sender: TObject);
begin
  edt_Dwmc.Text := DeCrypt(edt_Code.Text);
end;

procedure TForm1.btn_EncryptClick(Sender: TObject);
begin
  edt_Code.Text := Encrypt(edt_Dwmc.Text);
end;

procedure TForm1.edt_CodeChange(Sender: TObject);
begin
  btn_Decrypt.Enabled := edt_Code.Text<>'';
end;

procedure TForm1.edt_DwmcChange(Sender: TObject);
begin
  btn_Encrypt.Enabled := edt_Dwmc.Text<>'';
end;

end.
